use crate::convert::IntoResponse;

pub struct WithStatus<T, const CODE: u16>(pub T);

impl<T: IntoResponse, const CODE: u16> IntoResponse for WithStatus<T, CODE> {
    fn status_code(&self) -> u16 {
        CODE
    }

    fn content_type(&self) -> crate::http::HttpContentType {
        self.0.content_type()
    }

    fn into_body(self) -> Vec<u8> {
        self.0.into_body()
    }
}